import request from '@/utils/request'

// 查询亿图权限点列表
export function listResource(query) {
  return request({
    url: '/yt-resource/list',
    method: 'get',
    params: query
  })
}


// 根据角色ID查询菜单下拉树结构
export function tenantMenuTreeselect(tenantId) {
  return request({
    url: '/yt-resource/roleMenuTreeselect/' + tenantId,
    method: 'get'
  })
}

// 查询菜单下拉树结构
export function treeselect() {
  return request({
    url: '/yt-resource/treeselect',
    method: 'get'
  })
}

// 查询亿图权限点详细
export function getResource(id) {
  return request({
    url: '/yt-resource/' + id,
    method: 'get'
  })
}

// 新增亿图权限点
export function addResource(data) {
  return request({
    url: '/yt-resource',
    method: 'post',
    data: data
  })
}

// 修改亿图权限点
export function updateResource(data) {
  return request({
    url: '/yt-resource',
    method: 'put',
    data: data
  })
}

// 删除亿图权限点
export function delResource(id) {
  return request({
    url: '/yt-resource/' + id,
    method: 'delete'
  })
}
